package com.dz51.core.page.commond;

import java.io.Serializable;
import java.util.Collection;

import com.dz51.core.basedao.query.IConditionBuilder.OrderType;
import com.dz51.core.json.JSONObject;
import com.dz51.core.page.Pager;

/**
 * @Title: BasePageCommond.java
 * @Package com.dz51.core.page.commond
 * @Description: 基础查询commond
 * @author Zhaoqt
 * @date 2014-5-11 上午2:00:46
 * @version V1.0
 */
public class BasePageCommond implements Serializable {

	private static final long serialVersionUID = 1L;
	private Collection<?> resultCollection;
	private JSONObject dataBean;
	private String orderBy;// 排序字段
	private String orderTypeStr;
	private OrderType orderType;
	private String property;// 查找属性名称
	private String keyword;// 查找关键字

	protected Pager pager = new Pager();

	public Integer getPageNumber() {
		return pager.getPageNumber();
	}

	public void setPageNumber(Integer pageNumber) {
		pager.setPageNumber(pageNumber);
	}

	public Integer getPageSize() {
		return pager.getPageSize();
	}

	public void setPageSize(Integer pageSize) {
		pager.setPageSize(pageSize);
	}

	public Integer getTotalCount() {
		return pager.getTotalCount();
	}

	public void setTotalCount(Integer totalCount) {
		pager.setTotalCount(totalCount);
	}

	public Integer getPageCount() {
		return pager.getPageCount();
	}

	public void setPageCount(Integer pageCount) {
		pager.setPageCount(pageCount);
	}

	public JSONObject getDataBean() {
		return dataBean;
	}

	public void setDataBean(JSONObject dataBean) {
		this.dataBean = dataBean;
	}

	public Collection<?> getResultCollection() {
		return resultCollection;
	}

	public void setResultCollection(Collection<?> resultCollection) {
		this.resultCollection = resultCollection;
	}

	public String getOrderBy() {
		return orderBy;
	}

	public void setOrderBy(String orderBy) {
		this.orderBy = orderBy;
	}

	public String getOrderTypeStr() {
		return orderTypeStr;
	}

	public void setOrderTypeStr(String orderTypeStr) {
		this.orderTypeStr = orderTypeStr;
	}

	public String getProperty() {
		return property;
	}

	public void setProperty(String property) {
		this.property = property;
	}

	public String getKeyword() {
		return keyword;
	}

	public void setKeyword(String keyword) {
		this.keyword = keyword;
	}

	public Pager getPager() {
		return pager;
	}

	public void setPager(Pager pager) {
		this.pager = pager;
	}

	public OrderType getOrderType() {
		if (orderTypeStr != null && !"".equals(orderTypeStr)) {
			if (OrderType.ASC.equals(orderTypeStr.trim().toUpperCase())) {
				return OrderType.ASC;
			} else {
				return OrderType.DESC;
			}
		}
		return orderType;
	}

	public void setOrderType(OrderType orderType) {
		this.orderType = orderType;
	}

}
